﻿using FB.Data.Models;
using FB.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FB.Providers.AEInfo
{
    [Table("BASE_AEBaseInfos", Schema = "ae")]
    public class AEBaseInfo : FBAuditModel
    {
        public AEBaseInfo() { }

        [Key, StringLength(16)]
        [Display(ResourceType = typeof(Resources.Models.AEInfo), Name = "AECode")]
        public string AECode { get; set; }

        [StringLength(256)]
        [Display(ResourceType = typeof(Resources.Models.AEInfo), Name = "UserName")]
        public string UserName { get; set; }

        [Display(ResourceType = typeof(Resources.Models.AEInfo), Name = "UserID")]
        public Guid? UserID { get; set; }

        public long? DetailID { get; set; }

        [EnumDataType(typeof(AEMappingType))]
        public AEMappingType? MappingType { get; set; }

        [StringLength(16)]
        public string MasterAECode { get; set; }

        public bool Costed { get; set; }

        [ForeignKey("DetailID")]
        public virtual AEDetail Detail { get; set; }
    }


    [Table("BASE_AEMappingHistories", Schema = "ae")]
    public class AEMappingHistory : FBAuditModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        [StringLength(16), Required]
        public string AECode { get; set; }

        public long? DetailID { get; set; }

        [DataType(DataType.Date), Required]
        public DateTime EffectiveDate { get; set; }

        [EnumDataType(typeof(AEMappingType))]
        public AEMappingType? MappingType { get; set; }

        [StringLength(16)]
        public string MasterAECode { get; set; }

        public bool Costed { get; set; }
    }

}
